export function uniqueObjectArray<T>(arr: T[], key: (item: T) => any): T[] {
    const uniqueMap = new Map<any, T>();
    arr.forEach(item => {
        const keyValue = key(item);
        if (!uniqueMap.has(keyValue)) {
            uniqueMap.set(keyValue, item);
        }
    });
    return Array.from(uniqueMap.values());
}

export function mergeArrays<T>(arr1: T[], arr2: T[]): T[] {
    const mergedSet = new Set([...arr1, ...arr2]);
    return Array.from(mergedSet);
}